#include "EZ_Thread.h"
#include "ARMCM3.h"



void SysTick_Handler () 
{

	tick_increase();
	
	-- cur_task->remaining_tick;
	if (cur_task->remaining_tick == 0)
	{
			/* change to initialized tick */
			cur_task->remaining_tick = cur_task->init_tick;

			/* yield */
			task_yield();
	}
	
	timer_check();

}

uint32_t ez_hw_interrupt_disable(void)
{
	uint32_t state;
	state = __get_PRIMASK();
	return state;
	
}

void 	ez_hw_interrupt_enable(uint32_t state)
{
    __set_PRIMASK(state);
}

